package com.chance.cc.crawler.prod.command.trigger.domain.news.sina;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.news.sina.module.*;
import com.chance.cc.crawler.prod.command.job.domain.news.sina.searchKw.SinaCjSearchKwTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.sina.searchKw.SinaSearchKwTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @author lt
 * @version 1.0
 * @date 2020-12-09 16:15:28
 * @email okprog@sina.com
 */
public class SinaCommonCrawlerScheduleTrigger extends CommonCrawlerSchedulerTrigger {


    public static void main(String[] args) {
//        publishSinaSportsRealtimeCrawlerScheduleTriggerInfo();
//        publishSinaSportsTraceCrawlerScheduleTriggerInfo();
        publishSinaSportsTraceTraceCrawlerScheduleTriggerInfo();
//        publishSinaSportsSimpleCrawlerScheduleTriggerInfo();

//        publishSinaMpRealtimeCrawlerScheduleTriggerInfo();
//        publishSinaMpTraceCrawlerScheduleTriggerInfo();

//        publishSinaEstationRealtimeCrawlerScheduleTriggerInfo();
//        publishSinaEstationTraceCrawlerScheduleTriggerInfo();

//        publishSinaAutoRealtimeCrawlerScheduleTriggerInfo();
//        publishSinaAutoTraceCrawlerScheduleTriggerInfo();

//        publishSinaSearchKwTraceCrawlerScheduleTriggerInfo();
//        publishSinaCjSearchKwTraceCrawlerScheduleTriggerInfo();

    }

    public static void publishSinaCjSearchKwTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = SinaCjSearchKwTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                SinaCjSearchKwTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 10 2 * * ?",
                "新浪财经关键词查询每天凌晨2:10回溯七天数据"
        );
//
    }

    public static void publishSinaSearchKwTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = SinaSearchKwTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                SinaSearchKwTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 10 2 * * ?",
                "新浪关键词查询每天凌晨2:10回溯七天数据"
        );
//
    }

    /**
     * 发布汽车之家新闻trigger info
     */
    public static void publishSinaSportsTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = SinaSportTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                SinaSportTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 0/1 * * ?",
                "新浪体育新闻回溯采集任务执行，每一个小时执行一次"
        );
    }

    public static void publishSinaSportsTraceTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = SinaSportTraceTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                SinaSportTraceTraceCrawlerSchedulerJob.domain,
//                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
//                "",
                "新浪体育新闻回溯7天，凌晨1点开启"
        );
    }

    public static void publishSinaSportsSimpleCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = SinaSportSimpleCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                SinaSportSimpleCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "新浪体育新闻临时采集"
        );
    }

    /**
     * 发布汽车之家新闻trigger info
     */
    public static void publishSinaSportsRealtimeCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = SinaSportRealtimeCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                SinaSportRealtimeCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/10 * * * ?",
                "新浪体育新闻实时采集任务执行，每十分钟执行一次"
        );
    }

    /**
     * 发布汽车之家新闻trigger info
     */
    public static void publishSinaMpRealtimeCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = SinaMpRealtimeCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                SinaMpRealtimeCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/10 * * * ?",
                "新浪自媒体实时采集任务执行，每十分钟执行一次"
        );
    }
    //新媒体回溯
    public static void publishSinaMpTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = SinaMpTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                SinaMpTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "新浪自媒体回溯，每天凌晨一点"
        );
    }

    public static void publishSinaEstationRealtimeCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = SinaEstationRealtimeCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                SinaEstationRealtimeCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/10 * * * ?",
                "新浪新能源实时，每10分钟采集一次"
        );
    }

    public static void publishSinaEstationTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = SinaEstationTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                SinaEstationRealtimeCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 5 1 * * ?",
                "新浪新能源回溯，凌晨1点5分开始采集"
        );
    }

    public static void publishSinaAutoRealtimeCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = SinaAutoRealtimeCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                SinaAutoRealtimeCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0/10 * * * ?",
                "新浪汽车板块实时，每10分钟采集一次"
        );
    }

    public static void publishSinaAutoTraceCrawlerScheduleTriggerInfo(){
        CrawlerJob crawlerJob = SinaAutoTraceCrawlerSchedulerJob.crawlerSchedulejob();

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                SinaAutoTraceCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 1 * * ?",
                "新浪汽车板块回溯，凌晨1点采集"
        );
    }
}
